package net.hn.hnms.biz.plan.mapper;

import net.hn.hnms.biz.plan.request.ProductionMarketingCountReq;
import net.hn.hnms.biz.plan.request.SalesPlanReq;
import net.hn.hnms.biz.plan.vo.*;
import net.hn.hnms.biz.plan.vo.energy.YearEnergyStatisticsVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Component
public interface StatisticMapper{


    PlanCompleteStatisticVO planComplete(@Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode );
    PlanCompleteStatisticVO planComplete2(@Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode );
    PlanCompleteStatisticVO planComplete3(@Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode );


    PlanOtherStatisticVO planOther(@Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);

    List<MonthValue> sumCost(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);

    List<MonthValue> sumOutput(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);

    List<MonthValue> sumCostAndRealOutput(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);

    List<MonthValue> sumPlanOutputAndRealOutput(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);

    List<MonthValue> sumRealOutput(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);

    List<MonthValue> miningOrDrivageTrend(@Param("beginDate") Date startDate, @Param("endDate") Date endDate,@Param("type") String type, @Param("mineCode") String mineCode);

    List<MonthValue> selectStaffNumberOfMonth(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);

    List<MonthValue> planSaleOfMonth(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);//
    List<MonthValue> planSaleCompanyOfMonth(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("companyCode") String companyCode);//

    List<MonthValue> groupPlanSaleCompanyOfMonth(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("companyCode") String companyCode);//

    List<MonthValue> realSaleOfMonth(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);

    List<MonthValue> sumEnergyCost(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);

    MonthValue costWaterAndElectricity(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);


    List<ExecutionSalesVo> executionSaleCount(@Param("req") SalesPlanReq req);
    List<ExecutionSalesVo> groupExecutionSaleCount(@Param("req") SalesPlanReq req);

    List<ExecutionSalesVo> SaleBarChartCount(@Param("req") SalesPlanReq req);

    List<ExecutionSalesVo> GroupSaleBarChartCount(@Param("req") SalesPlanReq req);




    PlanOtherStatisticVO planOtherPower(@Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);

//    AttendanceEfficiencyVO selectAttendanceEfficiencyByYears(@Param("years") String years,@Param("mineCode") String mineCode);
    List<MonthValue> selectAttendanceEfficiencyByYears(@Param("years") String years,@Param("mineCode") String mineCode);

    MonthYieldVo planYield(@Param("monthBeginDate") Date monthBeginDate, @Param("monthEndDate") Date monthEndDate, @Param("yearBeginDate") Date yearBeginDate, @Param("yearEndDate") Date yearEndDate, @Param("mineCode") String mineCode);

    MonthYieldVo planActual(@Param("monthBeginDate") Date monthBeginDate, @Param("monthEndDate") Date monthEndDate,@Param("yearBeginDate") Date yearBeginDate, @Param("yearEndDate") Date yearEndDate, @Param("mineCode") String mineCode);

    MonthYieldVo planMining(@Param("monthBeginDate") Date monthBeginDate, @Param("monthEndDate") Date monthEndDate,@Param("yearBeginDate") Date yearBeginDate, @Param("yearEndDate") Date yearEndDate, @Param("mineCode") String mineCode);

    MonthYieldVo planDrivage(@Param("monthBeginDate") Date monthBeginDate, @Param("monthEndDate") Date monthEndDate,@Param("yearBeginDate") Date yearBeginDate, @Param("yearEndDate") Date yearEndDate, @Param("mineCode") String mineCode);

    MonthYieldVo planSale(@Param("monthBeginDate") Date monthBeginDate, @Param("monthEndDate") Date monthEndDate,@Param("yearBeginDate") Date yearBeginDate, @Param("yearEndDate") Date yearEndDate, @Param("mineCode") String mineCode);

    MonthYieldVo planActualSale(@Param("monthBeginDate") Date monthBeginDate, @Param("monthEndDate") Date monthEndDate,@Param("yearBeginDate") Date yearBeginDate, @Param("yearEndDate") Date yearEndDate, @Param("mineCode") String mineCode);

    MonthYieldVo backCoal(@Param("monthBeginDate") Date monthBeginDate, @Param("monthEndDate") Date monthEndDate, @Param("mineCode") String mineCode);

    BigDecimal stock(@Param("years") String years, @Param("mineCode") String mineCode);

    Integer existence(@Param("years") String years, @Param("mineCode") String mineCode);

    StatisticalYearVo rawCoalStock (@Param("years") String years, @Param("mineCode") String mineCode);

    StatisticalYearVo rawCoalBackCoal (@Param("years") String years, @Param("mineCode") String mineCode);

    StatisticalYearVo rawCoalCoalSlime (@Param("years") String years, @Param("mineCode") String mineCode);

    StatisticalYearVo rawCoalShaleAmount (@Param("years") String years, @Param("mineCode") String mineCode);

    StatisticalYearVo rawCoalPlanSale (@Param("years") String years, @Param("mineCode") String mineCode);

    StatisticalYearVo innerSell (@Param("years") String years, @Param("mineCode") String mineCode);

    StatisticalYearVo outerSell (@Param("years") String years, @Param("mineCode") String mineCode);

    StatisticalWeekVo planSaleOfMonths(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);

    StatisticalWeekVo planSaleOfYears(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);

    ExecutionSaleVo ExecutionSale(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);


    List<MonthValue> salveCount(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);

    List<MonthValue> salveCompanyCount(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("companyCode") String companyCode);

    List<MonthValue> achievementsLastSixMonths(@Param("companyCode") String companyCode);

    List<MonthValue> gtySalePlanLastSixMonths(@Param("companyCode") String companyCode);


    FootAgeVo drivageCount(@Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);
    FootAgeVo miningCount(@Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("mineCode") String mineCode);


    List<ProductionMarketingCountVo> selectProductionMarketing(@Param("req") ProductionMarketingCountReq req);
    ProductionMarketingCountVo selectProductionMarketingCountByCoalType(@Param("req")ProductionMarketingCountReq req);
    void insertEnvironmentProtectionList(List<EnvironmentProtectionVo> recordsList);

    @Select("SELECT equipment_name,tp,id,instantaneous_flow,nh4n,mn,cod,ph,data_time FROM environment_protection;")
    List<EnvironmentProtectionVo> selectEnvironmentProtection();
    @Select("SELECT execution_footage_output.mine_code  mine_code FROM execution_footage_output GROUP BY execution_footage_output.mine_code")
    List<String> selectMineCode();
    @Select("SELECT execution_footage_output.company_code  mine_code FROM execution_footage_output GROUP BY execution_footage_output.company_code")
    List<String> selectcompanyCode();

    List<YearEnergyStatisticsVo> getYearOutput(@Param("mineCode")String mineCode, @Param("year")String year,@Param("lastYear")String lastYear);

    YearEnergyStatisticsVo yearPlanOutput(@Param("mineCode")String mineCode, @Param("year")String year);

    List<MonthValue> sumPlaceEnergyCost(@Param("beginDate") Date startDate, @Param("endDate") Date endDate, @Param("mineCode")String mineCode);
}
